<template>
  <div id="app">
    <div class="container">
      <!-- <img alt="Vue logo" src="./assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/> -->
      <keep-alive>
        <router-view v-if="$route.meta.keepAlive" />
        <!-- 底部导航 -->
      </keep-alive>
      <router-view v-if="!$route.meta.keepAlive" />
      <nav-view v-if="isShowNav"></nav-view>
    </div>
  </div>
</template>

<script>
  import navView from '@/components/nav.vue';
  // import '@/assets/js/main.js'
  export default {
    name: 'App',
    components: {
      navView
    },
    computed: {
      // 设置一个变量
      isShowNav() {
        // console.log(this.$route.path); // /detail
        if (this.$route.path === '/index' || this.$route.path === '/home' || this.$route.path === '/info' || this.$route
          .path === '/my') {
          return true
        } else {
          return false;
        }
      }
    }
  }
</script>

<style scoped lang="less" rel="stylesheet/less">
  @import './assets/css/base.css';
  @import './assets/css/common.css';
</style>